<?php
namespace Mouta\UserBundle\Form\Type;

use Mouta\AmistateBundle\Entity\Usuario;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class SobreMiType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('nombre')
            ->add('apellido')
            ->add('plainPassword', 'repeated', array(
                'type' => 'password',
                'invalid_message' => 'Las claves no coinciden',
                'required' => false,
                'first_options'  => array('label' => 'Clave'),
                'second_options' => array('label' => 'Repetir clave'),
            ))
            ->add('recibomail','choice', array(
                'choices'   => array('1' => 'Si', '0' => 'No'),
                'label'  => 'Recibir E-mail',
                'empty_value' => false
            ))
            ->add('sexo','choice', array(
                'choices'   => array('0' => 'Hombre', '1' => 'Mujer'),
                'required'  => false,
				'label'  => "Soy",
                'empty_value' => false
            ))
            ->add('cumple','birthday', array(
                'format' => 'ddMMyyyy',
                'label'  => 'Cumpleaños',
                'years' => range(date('Y'), date('Y')-70)
            ))
            ->add('descripcion','textarea', array(
                'label'  => 'Descripción',
                'attr' => array('rows' => '6'),
            ))
            ->add('busco','choice', array(
                'choices'   => array('0' => 'Hombre', '1' => 'Mujer'),
                'required'  => false,
                'empty_value' => false
            ))
            ->add('para','choice', array(
                'choices'   => Usuario::getOpcionesPara(),
                'required'  => false,
                'empty_value' => false
            ));


    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Mouta\AmistateBundle\Entity\Usuario',
            'csrf_protection' => true,
            'csrf_field_name' => '_token',
        ));
    }

    public function getName()
    {
        return 'SobreMi';
    }


}